﻿@model DHQGHN.PM2.Models.EnumeratorSearchModel
@{
    ViewBag.Title = "SearchResult";
    Layout = "~/Views/Shared/_LayoutBusiness.cshtml";
}

<link href="@Url.Content("~/Content/jquery-ui.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.10.2.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.10.2.js")" type="text/javascript"></script>

<script>
    $(function () {
        $("#btnSearch").click(function () {
            var adminID = $('#ADMINIS_UNIT_ID').val();
            var areaID = $('#AREA_ID').val();
            var fullName = $('#FULL_NAME').val();
            $.ajax({
                cache: false,
                url: '@Url.Action("SearchResult")',
                type: 'POST',
                data: {
                    AdminisUnitID: adminID, AreaID: areaID, FullName: fullName
                },
                success: function (dataResult) {
                    $("#searchresult").html('');
                    $("#searchresult").html(dataResult);
                },
                error: function (ex) {
                    alert('Lỗi kỹ thuật.' + JSON.stringify(ex));
                }
            });
            return false;
        });
    });
</script>

<h3>SearchResult</h3>
@Html.HiddenFor(model => model.ADMINIS_UNIT_ID)
<div class="form-horizontal" align ="center">
    <table>
        <tr>
            <td align="left">
                @Html.Label("DVHC: ", new {@class = "control-label col-md-2" })
            </td>
            <td>
                @Html.TextBox("dvhc", "Văn Cẩm")
            </td>
            <td>
                @Html.Label("Dia ban: ", new { @class = "control-label col-md-2" })
            </td>
            <td>
                @Html.DropDownListFor(model => model.AREA_ID, ViewBag.AreaItems as List<SelectListItem>, "Chon dia ban")
            </td>
            <td>
                @Html.Label("Ho ten: ", new { @class = "control-label col-md-2" })
            </td>
            <td>
                @Html.TextBoxFor(model => model.FULL_NAME, new { placeholder = "ho ten" })
            </td>
        </tr>
    </table>
    <div align="center">
        <button id="btnSearch">Tìm Kiếm</button>
        <button value="Quay lại" onclick="window.location.href='@Url.Action("Details")'">Chi tiet</button>
    </div>
    <br />
    <div id="searchresult"></div>
</div>
